package com.wxzhou.wangzhuan.security;

import java.security.Principal;

/**
 * 自定义Principal
 */
public class CustomPrincipal implements Principal {

    private final Long userId;
    private final String deviceId;
    private final String channel;
    private final Integer userLevel;

    public CustomPrincipal(Long userId, String deviceId, String channel, Integer userLevel) {
        this.userId = userId;
        this.deviceId = deviceId;
        this.channel = channel;
        this.userLevel = userLevel;
    }

    @Override
    public String getName() {
        return userId + "";
    }

    public Long getUserId() {
        return userId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public String getChannel() {
        return channel;
    }

    public Integer getUserLevel() {
        return userLevel;
    }
}